package com.quanquan.store.entity.marketActivity;

import lombok.Data;

/**
 * @ClassName GiftTypeEnum
 * @Description
 * @Author Owen
 * @Date 2019/8/28 0028 上午 11:12
 * @Version V1.0
 **/
public enum GiftTypeEnum {

    NO_GIF(0,"未中奖"),
    COUPON_GIFT(1,"优惠券"),
    POINT_GIFT(2,"积分");

    private int code;

    private String description;

    public int getCode(){
        return code;
    }

    public String getDescription(){
        return description;
    }

    GiftTypeEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static GiftTypeEnum getGiftType(int code){
        for (GiftTypeEnum giftType:values()){
            if(giftType.getCode() == code){
                return giftType;
            }
        }
        return null;
    }
}
